import {request} from '@/utils/request'

const baseURL='http://47.105.122.163:13311/'
const apiUrl = '/yesiot/visual/display/'


export function visualList(devCode) {
    return request({
        baseURL: baseURL,
        url: `${apiUrl}list/dev/id/${devCode}`,
        method: 'get'
    })
}
export function searchFarmId(farmId) {
    return request({
        baseURL: baseURL,
        url: `${apiUrl}list/farmId/${farmId}`,
        method: 'get'
    })
}
export function save(data) {
    return request({
        baseURL: baseURL,
        url: `${apiUrl}save`,
        method: 'post',
        data
    })
}
export function update(data) {
    return request({
        baseURL: baseURL,
        url: `${apiUrl}update`,
        method: 'PUT',
        data
    })
}
export function del(id) {
    return request({
        baseURL:baseURL,
        url: `${apiUrl}delete/${id}`,
        method: 'DELETE',
    })
}

//根据多个设备号查询组态
export function listByDev(data) {
    return request({
        baseURL:baseURL,
        url: `${apiUrl}dev/code/list`,
        method: 'post',
        data
    })
}

//根据多个园区查询组态
export function listByFarm(data) {
    return request({
        baseURL:baseURL,
        url: `${apiUrl}farmId/list`,
        method: 'post',
        data
    })
}
